package com.superbytecode.cloud.common.utils.tree;

import lombok.Data;
import org.assertj.core.util.Lists;

import java.util.ArrayList;
import java.util.List;
/**
 * All rights Reserved, Designed By www.super-master.com
 *
 * @ProjectName: beacon-cloud
 * @Package: com.superbytecode.cloud.common.utils.tree
 * @ClassName: TreeVo
 * @Description: []
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2024/10/22 12:25
 * @Version: V1.0
 * @Copyright: 2024 www.super-master.com Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@Data
public class TreeVo {
    private Long parent;
    private Long id;
    private String name;
    private List<TreeVo> children;

    //
    public static TreeVo of(final Long parent, final Long id, final String name) {
        TreeVo treeVo = new TreeVo();
        treeVo.setParent(parent);
        treeVo.setId(id);
        treeVo.setName(name);
        treeVo.setChildren(Lists.newArrayList());
        return treeVo;
    }
}